#ifndef UTILS_H
#define UTILS_H

//#include "SFR.h"
#include "ulcd_defs.h"

extern volatile uint32_t sys_counter;
extern volatile uint32_t led_counter;

char* itoa3(char* data, int num);
char itoa(char data[5], int num);

char itoc(int num);

////////////////////////////////////////////////////////////////////////////////
#define ULCD_REG_LAST_PRESSEDBUTTON ULCD_REG_R16


//const char* GetSupCaption(int zNum);

void SetCaption(tulcdWidget* _panel, const char* _caption);

void SetCaption_num(tulcdWidget* widget, int _num);

void CreateButton(   tulcdWidget *button
                    , uint32_t _idParent
                    , const tXYWH* _xywh
                    , const char* _caption
                    , const uint8_t* _onEventScript
                    , const int size_ofEventScript
                    , const uint8_t _action);

//
void CreatePanel(   tulcdWidget *button
                    , uint32_t _idParent
                    , const tXYWH* _xywh
                    , const char* _caption, uint32_t cap_X, uint32_t cap_Y
                    , const uint8_t* _onEventScript
                    , const int size_ofEventScript
                    , const uint8_t _action);

//
void CreateText(   tulcdWidget *button
                    , uint32_t _idParent
                    , const tXYWH* _xywh
                    , const char* _caption
                    , const uint8_t* _onEventScript
                    , const int size_ofEventScript
                    , const uint8_t _action);

uint32_t CreateMainPanel(  const char* cap1, const char* cap2
                         , const char* cap3, const char* cap4
                         , uint32_t idFrame, tulcdWidget downBut[4]);

#endif // UTILS_H

